//
//  OldActivityDetailModel.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/7/24.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "OldActivityDetailModel.h"
#import "OldImageDetail.h"
#import "NSDate+Extension.h"

@implementation OldActivityDetailModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.avatarUrl = dict[@"avatarUrl"];
        self.clubId = [dict[@"clubId"] integerValue];
        self.clubLogo = dict[@"clubLogo"];
        self.clubName = dict[@"clubName"];
        self.webDynamicUrl = dict[@"webDynamicUrl"];
        self.createDate = [NSDate spToDateString:dict[@"createDate"]];
        for (NSDictionary *detailDict in dict[@"detailList"]) {
            OldImageDetail *model = [OldImageDetail objectWithDict:detailDict];
            [self.detailList addObject:model];
        }
        self.ID = [dict[@"id"] integerValue];
        self.title = dict[@"title"];
        self.status = [dict[@"status"] integerValue];
        self.videoName = dict[@"videoName"];
        self.videoUrl = dict[@"videoUrl"];
    }
    return self;
}

+ (instancetype)objectWithDict:(NSDictionary *)dict
{
    return [[OldActivityDetailModel alloc]initWithDict:dict];
}

- (NSMutableArray *)detailList
{
    if (!_detailList) {
        _detailList = [NSMutableArray array];
    }
    return _detailList;
}

@end
